//***************************************************************************
//*
//*	File:			dswl_windows.h
//*	Description:	Wrapper for IWindows interface
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			_DSWL_WINDOWS_H_INCLUDED
#define			_DSWL_WINDOWS_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- dswl_windows.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

#ifdef			_DSWL_SWITCH_USE_AUTOCAST
#ifdef			_DSWL_SWITCH_USE_UNSAFE_AUTOCAST
#pragma	message ( "-- dswl_windows.h \t Warning: Generating auto-cast operator: CIWindows::operator IWindows* () const" )
#else
#pragma	message ( "-- dswl_windows.h \t Warning: Generating auto-cast operator: CIWindows::operator       IWindows* ()" )
#pragma	message ( "-- dswl_windows.h \t Warning: Generating auto-cast operator: CIWindows::operator const IWindows* () const" )
#endif
#endif

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//------------------------------------------------------ FORWARD DECLARATIONS
//

class			CIApplication	;
class			CIGenericWindow	;

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CIWindows
//***************************************************************************
//*		@CLASS		Wrapper for IWindows interface
//***************************************************************************
class _DSWL_EXT_CLASS CIWindows  
{
	//																								
	//-----------------------------------------------------------------------						
	//***************************     ATTRIBS     ***************************						
	//-----------------------------------------------------------------------						
	//																								
private:																											// @ACCESS	Private Attributes	
			CComPtr< IWindows >		m_pIWindows			;															// @CMEMBER	Smart pointer to the actual text window interface
																												
	//																															
	//-----------------------------------------------------------------------													
	//*************************     PROPERTIES     **************************							
	//-----------------------------------------------------------------------													
	//																															
public:																												// @ACCESS	Public Property Methods
			CIApplication			GetApplication		( void )										const	;	// @CMEMBER	Returns the application the windows belong to
			long					GetCount			( void )										const	;	// @CMEMBER	Returns the number of windows in the container

	//																														
	//-----------------------------------------------------------------------												
	//*************************     INFORMATION     *************************							
	//-----------------------------------------------------------------------												
	//																														
public:																												// @ACCESS	Public Information Methods
			BOOL					IsNull				( void )										const	;	// @CMEMBER	Determines whether the internal pointer is <t NULL>
			BOOL					IsValid				( void )										const	;	// @CMEMBER	Determines whether the internal pointer differs from <t NULL>
																										
	//																												
	//-----------------------------------------------------------------------										
	//*********************     ELEMENT MANAGEMENT     **********************
	//-----------------------------------------------------------------------										
	//																												
public:																												// @ACCESS	Public Project Management Methods
			CIGenericWindow			GetAt				(		long				a_lIndex		)	const	;	// @CMEMBER	Determines the item at specified 0-based index. 
			CIGenericWindow			GetItem				(		long				a_lItem			)	const	;	// @CMEMBER	Determines the item at specified 1-based index. 

			void					Arrange				(		DsArrangeStyle		a_enuStyle		)			;	// @CMEMBER	Arranges the windows
			DsSaveStatus			CloseAll			(		BOOL				a_bSaveChanges	)			;	// @CMEMBER	Closes all windows

	//																										
	//-----------------------------------------------------------------------								
	//**************************     OPERATORS     **************************								
	//-----------------------------------------------------------------------								
	//																										
public:																												// @ACCESS	Public Operators
			bool					operator	==		( const CIWindows&			a_Other			)	const	;	// @CMEMBER	Comparison operator
			bool					operator	!=		( const CIWindows&			a_Other			)	const	;	// @CMEMBER	Comparison operator
			bool					operator	<=		( const CIWindows&			a_Other			)	const	;	// @CMEMBER	Comparison operator
			bool					operator	>=		( const CIWindows&			a_Other			)	const	;	// @CMEMBER	Comparison operator
			bool					operator	<		( const CIWindows&			a_Other			)	const	;	// @CMEMBER	Comparison operator
			bool					operator	>		( const CIWindows&			a_Other			)	const	;	// @CMEMBER	Comparison operator
																									
			CIWindows&				operator	=		(		IWindows*			a_pIOther		)			;	// @CMEMBER	Copy operator
																									
			IWindows*				operator	*		( void )												;	// @CMEMBER	Dereference operator
	const	IWindows*				operator	*		( void )										const	;	// @CMEMBER	Dereference operator
																										
			IWindows*				operator	->		( void )												;	// @CMEMBER	Member access operator
	const	IWindows*				operator	->		( void )										const	;	// @CMEMBER	Member access operator

			CIGenericWindow			operator	[]		(		int					a_iIndex		)	const	;	// @CMEMBER	Subscription operator
																										
	#ifdef	_DSWL_SWITCH_USE_AUTOCAST																
	#ifdef	_DSWL_SWITCH_USE_UNSAFE_AUTOCAST														
									operator			IWindows*	( void )							const	;	// @CMEMBER	TypeCast operator
	#else																								
									operator			IWindows*	( void )									;	// @CMEMBER	TypeCast operator
									operator	const	IWindows*	( void )							const	;	// @CMEMBER	TypeCast operator
	#endif																							
	#endif							
									
	//																								
	//-----------------------------------------------------------------------						
	//***********************     CON/DESTRUCTION     ***********************						
	//-----------------------------------------------------------------------						
	//																								
public:																												// @ACCESS	Public Con-/Destruction Methods	
			 CIWindows( IWindows* a_pIWindows = NULL );																// @CMEMBER	Default constructor
	virtual ~CIWindows();																							// @CMEMBER	Default destructor
};
//***************************************************************************
//**	@END
//***************************************************************************

#endif		// _DSWL_WINDOWS_H_INCLUDED
